home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 019a / bfedt111.zip / BF-EDIT.DOC next >
Text File  |  1991-04-02  |  13KB  |  328 lines

  1.                                Documentation for 
  2.                                   BF-EDIT.EXE
  3.                                  copyright 1990
  4.  
  5.                                   written by 
  6.                                 Douglas K. Brecht
  7.  
  8.  
  9.                     Important: Press F1 for HELP in BF-EDIT
  10.  
  11.  
  12.                                    DISCLAIMER
  13.  
  14. The BF-EDIT program comes "AS-IS", without warranty of any kind, express or
  15. implied.
  16.  
  17. Under no circumstances shall Douglas K. Brecht be held liable for any damages
  18. whatsoever arising out of the use of, or inability to use this product,
  19. including but not necessarily limited to, damages for loss of business
  20. profits, business interruption, or business information. 
  21.  
  22. All reasonable efforts have been made to ensure the reliability of this
  23. product. If for any reason the accuracy or reliability of this product is
  24. compromised, including reasons of oversight and/or negligence on the
  25. part of Douglas K. Brecht, your sole remedy shall be a refund of any
  26. registration fees paid.  In lieu of a refund, Douglas K. Brecht may, at his
  27. option, fix the problem which caused the unreliability. 
  28.  
  29.  
  30.                                   REGISTRATION
  31.  
  32. BF-EDIT is distributed as a shareware program.  If you find BF-EDIT to be
  33. useful, and use the program, a registration fee of $10 is greatly appreciated.
  34. Registered users will be notified of future releases, and may write for
  35. support at the address below, or on Compuserve (#72701,2263).
  36.  
  37. ALL users (registered or not) are encouraged to report any problems 
  38. encountered in running BF-EDIT, and to suggest additional features or
  39. enhancements.  I **hope** to have complete Search & Replace features soon, and
  40. possibly some kind of data conversion, that would output selected fields in
  41. various formats. Let me know what you'd like to see.
  42.  
  43. Douglas K. Brecht
  44. RR#2  Box 198
  45. Claremont, NH 03743
  46.  
  47.  
  48.                                 WHAT BF-EDIT DOES
  49.  
  50. BF-EDIT allows editing fixed record length files, such as Basic (or QuickBasic) random access files. This includes not only text, but data stored
  51. as integers, single or double precision numbers, and so on.  BF-EDIT actually
  52. stands for <B>asic <F>ile <EDIT>or.
  53.  
  54. BF-EDIT allows searching your files for either text or numeric values. 
  55.  
  56. BF-EDIT is a great debugging aid to quickly see what data is really in your
  57. files, without writing an edit program for every file structure you create. 
  58.  
  59. BF-EDIT is actually quite similar to the BROWSE feature in dBase 
  60.  
  61.  
  62.  
  63.                             WHAT BF-EDIT DOES NOT DO
  64.  
  65. BF-EDIT does not edit variable length records (such as most sequential files). 
  66.  
  67. BF-EDIT does not edit Btrieve or dBase files. 
  68.  
  69.  
  70.  
  71.                               THE "BF-EDIT" CONCEPT
  72.  
  73. BF-EDIT arose from the need to view and edit data files containing not only
  74. strings, but integers, long integers, and single and double precision numbers. 
  75. Text editors, PATCH, and the like are generally limited in that:
  76.  
  77. Numeric entries are not displayed in a usable form.
  78.  
  79. You therefore can't search for numeric values or ranges of numeric values.
  80.  
  81. While text editors allow you to perform string searches, you generally can't
  82. search for strings found only in particular fields
  83.  
  84. BF-EDIT does display numeric entries in a usable form, allows searching for
  85. specific values or a range of values, and allows searching for strings in
  86. specific fields.  Any information in the file may be edited.
  87.  
  88. While you could write programs that do this for each file structure you use or
  89. create BF-EDIT provides these features by just specifying the field layout. For
  90. example, if you have a 64 byte record layout that contains both string and
  91. numeric data, you could quickly create a "Type file" that details this record
  92. layout:
  93.  
  94. Cust Num as integer
  95. Last Name as string * 25
  96. First name as string * 20
  97. Balance as double
  98. Acct. Type as integer
  99. Nil as string * 7
  100.  
  101. With just this information, you can view your customer file, search for a
  102. specific customer number, view all your customers named "Jones", or those with
  103. a balance over $2,000.  Any information can be edited.  Records may be appended
  104. to the file.
  105.  
  106. QuickBasic 4.xx users may recognize that format as similar to a TYPE
  107. declaration.  This is intentional, and allows type declarations (such as in an
  108. include file) to be used directly as BF-EDIT type files. For instance, if your
  109. include file actually looked like this:
  110.  
  111. TYPE CUST
  112.     Num AS INTEGER
  113.     LName AS STRING * 25
  114.     FName AS STRING * 20
  115.     Balance AS DOUBLE
  116.     AcctType AS INTEGER
  117.     Nil AS STRING * 7
  118. END TYPE
  119.  
  120. you could use it as your BF-EDIT type file with no modifications whatsoever.  
  121.  
  122.  
  123.                           RUNNING FROM THE COMMAND LINE
  124.  
  125. When running BF-EDIT from the command line, the syntax is: 
  126.  
  127. BF-EDIT /T:type file  /D:data file /S:start record /MBF /GO 
  128.  
  129. NOTE: ALL of the parameters are optional, and their order is not important.
  130.  
  131. /T:type file   specify the name of the type file, including drive and path 
  132.  
  133. /D:data file   specify the name of the data file, including drive and path 
  134.  
  135. /S:start record   you may specify the lowest "legal" record number, such as to
  136. avoid accidentally editing header records 
  137.  
  138. /MBF specifies that the single and double precision numbers in your file are
  139. in MBF format. BASICA, GW-BASIC, and QuickBasic (version 1-3) files should use
  140. the /MBF parameter. QuickBasic version 4 and higher uses IEEE format files as
  141. the default, but also support the MBF format. 
  142.  
  143. /GO   to indicate that you don't want to view the opening screen, or review
  144. your parameters before starting to edit. If you use the /GO option, you must
  145. have also specified the Type file and Data file. This is most often used as part of a batch file that is specifying all the needed parameters.
  146.  
  147.  
  148.                   ENTERING THE PARAMETERS FROM WITHIN BF-EDIT
  149.  
  150. If you do not enter the Type file name, Data file name, or starting record
  151. number on the command line, you may enter them when prompted inside BF-EDIT.
  152.  
  153.  
  154.                             CREATING YOUR TYPE FILE
  155.  
  156. The TYPE file must be pure text, and can be created using whatever text-editor
  157. you generally edit program code with. If you use a word-processor such as
  158. WordStar make sure that you do so in the Non-document mode. 
  159.  
  160. If you enter a non-existing TYPE file name inside BF-EDIT you will be asked if
  161. you want to create that file. If you respond with a Y, you can then create your
  162. TYPE file using BF-EDITs built in editor. 
  163.  
  164.  
  165. WHAT GOES IN THE TYPE FILE? 
  166.  
  167. You must list the name and type of each field used in your file. An example of
  168. a TYPE file is: 
  169.  
  170. Custnam AS STRING * 30 
  171. ' last name, then first 
  172. Custnum AS INTEGER 
  173. Balance AS DOUBLE 
  174. PhoneNum AS STRING * 18 
  175. Nil AS STRING * 6 
  176.  
  177. Important: the total length of the fields listed in the type file must EQUAL
  178. the actual record length. If you do not use all the characters available, use
  179. "phony" fields (such as the field labeled "Nil" above) to make the total equal
  180. to the record length. 
  181.  
  182.  
  183. THE RULES: GENERAL 
  184.  
  185. Each line in the Type file can contain an instruction, a comment, or both. Any
  186. line that does not have the word "AS" in it, or any line that starts with an
  187. apostrophe, is treated as a comment. Each line in the type file may be any
  188. length, however lines of 72 characters or less are recommended. Lines longer
  189. than that can not be edited in the BF-EDIT program. 
  190.  
  191. Capitals or lower-case letters are both acceptable. 
  192.  
  193.  
  194. THE RULES: FIELD NAMES (labels) 
  195.  
  196. Each instruction line should start with the name of the field. These field
  197. names may be up to 12 characters long and may contain spaces. The only
  198. restrictions are that the field name may not be "AS", and should not have a
  199. forward slash "/" in it. The following are all valid field names: 
  200.  
  201. Cust Num 
  202. Acct Balance 
  203. Account Balance   (only 12 characters, "Account Bala", will be used) 
  204. Date 
  205. Name 
  206.  
  207. The field name MUST be followed with the word "AS" 
  208.  
  209.  
  210. THE RULES: NUMERIC ENTRIES 
  211.  
  212. The syntax for listing numeric fields is: 
  213.  
  214. fieldname AS [INTEGER, LONG, SINGLE, DOUBLE, CHAR] 
  215.  
  216. Integers are stored as 2-bytes in the file, Long integers as 4-bytes, Single
  217. precision numbers as 4-bytes, and Double precision numbers as 8-bytes. 
  218.  
  219. You will not be allowed to enter any value that is larger or smaller than that
  220. variable type allows. 
  221.  
  222. Quite often files will contain a 1-byte character that stores a value from 0
  223. to 255. The value of those characters can be viewed or edited using the CHAR
  224. type.
  225.  
  226.  
  227.  
  228. THE RULES: STRINGS 
  229.  
  230. The syntax for listing string fields is: 
  231.  
  232. fieldname AS STRING * length 
  233.  
  234. Strings can be from 1 to 65 bytes long. If your file has longer strings, you
  235. must divide them up among several smaller string fields, each no more than 65
  236. bytes. For example, to list a string 80 bytes in length, you could do it like
  237. this: 
  238. Descript1 AS STRING * 65 
  239. Descript2 AS STRING * 15 
  240.  
  241. or like this: 
  242.  
  243. Descript1 AS STRING * 40 
  244. Descript2 AS STRING * 40 
  245.  
  246.  
  247. THE RULES: MODIFIERS 
  248.  
  249. In addition to specifying the fieldname, and type of variable, there are also
  250. certain modifiers than can be used at the end of a description line in the
  251. TYPE file. The following screens will describe them: 
  252.  
  253.  
  254. THE /IGNORE MODIFIER 
  255.  
  256. You may tell the BF-EDITor to ignore any field that you do not want to display
  257. or edit from within BF-EDIT. This is commonly used to ignore "nil" fields;
  258. fields used as character placeholders without really containing any data. For
  259. example: 
  260.  
  261. Nil AS STRING * 6    ' /IGNORE 
  262.  
  263. Note that in the example above, the apostrophe is not required. Using the
  264. apostrophe before the modifier does allow you to use the TYPE file as an
  265. INCLUDE file in a QuickBasic program, however. 
  266.  
  267.  
  268. THE /NUM MODIFIER 
  269.  
  270. Within BF-EDIT, fields that are always numeric (integers, longs, etc.) are
  271. treated differently than strings. Only numbers, decimal points, and plus or
  272. minus signs are allowed. Also, searching numeric fields allows you to look for
  273. a numeric range of values, rather than a specific string pattern. Using the
  274. /NUM modifier imparts those same conditions on string fields. 
  275.  
  276.  
  277. An example would be if you store invoice totals as a string in your file.
  278. Since you don't want anyone accidentally typing in non-numeric characters, and
  279. you might want to search for an invoice value or range of values, you might
  280. want to include the /NUM modifier to the end of the description line, such as: 
  281.  
  282. InvAmount AS STRING * 10   /NUM 
  283.  
  284. This would restrict entry of that field to numeric characters, and allow you
  285. to search for invoice totals between, say, 1,000 and 2,000 dollars. 
  286.  
  287.  
  288. THE /MBF MODIFIER 
  289.  
  290. If some of the Single or Double precision numbers in the Data file are in the
  291. MBF format, you can use the /MBF modifier on that line. Otherwise, the number
  292. will be interpreted as being in the IEEE format...and the number displayed
  293. will be wrong. BASICA, GW-BASIC, and QuickBasic before version 4 use only the MBF format. 
  294.  
  295. THE DATA FILE:  /D:
  296. The DATA FILE is your file that you wish to edit with BF-EDIT. It must
  297. be a fixed record-length file, such as a Basic random access file. Files with
  298. variable length records (such as most sequential files) can not be edited with
  299. BF-EDIT. Specify here the complete path name to the file, such as: 
  300.  
  301. D:\ACCT\CHECKFIL.DAT 
  302.  
  303.  
  304.                                       TIPS
  305.  
  306. *** The most common problem I have encountered myself is in incorrectly
  307. specifying the record length.  In other words, I might have a file with a
  308. 64-byte record length, but in creating my Type file I only specify, say, 63
  309. bytes.  This problem is easy to detect because the first record will generally
  310. look fine, the second record will have its data "shifted" by 1 or more bytes,
  311. and each succeeding record will look a little worse.
  312.  
  313. *** If the floating point numbers in the file are incorrect, it may mean that
  314. you need to specify the /MBF option when calling BF-EDIT, or use the /MBF
  315. modifier on each line that uses MBF single and double precision numbers.
  316.  
  317. *** When programming in QuickBasic, I put most of my TYPE declarations in
  318. Include files.  I then use those Include files as BF-EDIT Type files as well.
  319. Put any modifiers AFTER apostrophes so that QB will ignore them; BF-EDIT still
  320. uses them.  For instance:
  321.  
  322. InvAmount as string * 10  '/NUM
  323. Nil as string * 4         '/IGNORE
  324.  
  325. In both these cases the modifier will be seen by BF-EDIT, but ignored by QB.
  326.  
  327. *** There is On-line help everywhere in BF-EDIT. Simply press F1.
  328.